#pragma once
#include <string>
#include <boost\asio\deadline_timer.hpp>

namespace boost{
	namespace system {
		class error_code;
	}
}

class CQPlayer;
class CQTimer
{
public:
	CQTimer(CQPlayer* cqp, const std::string& m, time_t t = 1000);
	virtual ~CQTimer();

public:
	void cancel();
	void timerCallback(const boost::system::error_code& errcode);
	std::string getMsg();
private:
	void start();

private:
	boost::asio::deadline_timer* _timer;
	std::string _msg;
	time_t _t;
	bool _isCancelled;
	static CQPlayer* _cqp;
};